from expression import expression
from customExceptions import ReturnExcpt

class Return(expression):
	def __init__(self, expr):
		self.expr = expr
	def evaluate(self, env):
		#print "Returning: ", self.expr
		try:
			value = self.expr.evaluate(env)
			#print "Evaluated value: ", value
		except ReturnExcpt:
			print "ERROR: What the heck, a return in a return?"
		else:
			raise ReturnExcpt(value)
	
